import { Module } from 'vuex'

interface UProp{
  username: string;
}

/**
 * 模块调用方法
 * dispatch('模块名/action名',参数)
 * commit('模块名/mutation名',参数)
 */

const subStore: Module<UProp, StoreProp> = {
  namespaced: true,
  state: {
    username: 'leisuchu'
  },
  mutations: {
    setUserName (state) {
      state.username = 'nakura'
    }
  },
  actions: {
    logTest () {
      console.log('user action test')
    }
  }
}

export default subStore
